import Icon from 'ant-design-vue/es/icon'
export default {
  name: 'icon',
  props: {
    icon: {
      type: String,
      default: ''
    }
  },
  data () {
    return {}
  },
  render () {
    const icon = this.icon
      if (icon !== 'none' && icon !== undefined && icon.indexOf("cus_" ) !== -1) {
        let className = "action-jeecg " + icon.substr(4);
        return (<i class= {className} style="font-size: 18px;"></i>)
      }
      if (icon === 'none' || icon === undefined) {
        return null
      }
      const props = {}
      typeof (icon) === 'object' ? props.component = icon : props.type = icon
      return (
        <Icon style="font-size: 18px;" {... { props } }/>
    )
  }
}
